/*
 * Copyright @ 2018 河南雪城软件有限公司  All rights reserved.
 *
 */

package com.hw.one.peach.da.controller;

import com.hw.one.core.controller.BaseController;
import com.hw.one.core.logger.annotation.SystemLog;
import com.hw.one.core.logger.constant.LogConstants;
import com.hw.one.core.result.MsgResult;
import com.hw.one.peach.da.service.IPeachSiteService;

import io.swagger.annotations.ApiOperation;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 详细描述
 * </p>
 *
 * @author Erick
 * @date 2018/4/17
 */
@RestController
@RequestMapping("peachSite")
public class PeachSiteController extends BaseController {

	@Resource
	private IPeachSiteService peachSiteService;

	/**
	 * 获取站点列表
	 * @return List<map> 
	 */
	@ApiOperation(value = "站点", notes = "获取站点列表", httpMethod = "GET")
	@SystemLog(moduleName = "站点", description = "获取站点列表", operType = LogConstants.OPER_SELECT)
	@Override
	public MsgResult get(HttpServletRequest request) {
		Map<String, Object> params = wrapParams(request);
		MsgResult result = null;
		try {
			result = peachSiteService.get(params);
		} catch (Exception e) {
			log.error("无参查询异常", e);
		}
		return result;
	}
	
	/**
	 * 获取站点列表
	 * @return List<map> 
	 */
	@ApiOperation(value = "站点", notes = "获取站点列表", httpMethod = "GET")
	@SystemLog(moduleName = "站点", description = "获取站点列表", operType = LogConstants.OPER_SELECT)
	@RequestMapping(path = "range", method = RequestMethod.GET)
	public MsgResult getRangeBySite(HttpServletRequest request) {
		Map<String, Object> params = wrapParams(request);
		MsgResult result = null;
		try {
			result = peachSiteService.getRangeBySite(params);
		} catch (Exception e) {
			log.error("无参查询异常", e);
		}
		return result;
	}
}
